﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Cwjk_PzRuleSet_OperType_Edit.aspx.vb" Inherits="PubProject.Cwjk_PzRuleSet_OperType_Edit" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<head runat="server">
    <title>新增业务场景</title>
    <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
	<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
	<meta content="JavaScript" name="vs_defaultClientScript">
	<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
	<link rel="stylesheet" type="text/css" href="/_grid/map_grid.css">
	<link rel="stylesheet" type="text/css" href="/_nav/menu.css">
	<script language="javascript" src="/_common/scripts/global.js"></script>
	<link rel="stylesheet" type="text/css" href="/_forms/styles/form.css">
	<link rel="stylesheet" type="text/css" href="/_common/styles/global.css">
	<script language="javascript" src="/_controls/settings.aspx"></script>
	<script language="javascript" src="/_controls/util/util.js"></script>
	<script language="javascript" src="Cwjk_Public.js"></script>
	<script language="javascript">
	    var _MyHelpfile = "/Cbgl/HELP/topics/财务人员/设置财务接口/设置凭证规则.html";
	    function window.onload()
        {
            if (document.all["txtApplication"] && document.all["txtApplication"].value == "0101")
	        {
	            _MyHelpfile = "/Slxt/Help/topics/财务管理/财务接口设置/设置凭证规则.html";
	        }
        }
	    function Save()
	    {
	        if(document.all["txtOperType"].value == "")
	        {
	            alert("业务场景不允许为空！");
	            return;
	        }
	        if(document.all["txtUsedScope"].value == "")
	        {
	            alert("适用范围不允许为空！");
	            return;
	        }
	        //保存业务场景
		    var sFile = "/PubProject/CWJK/Cwjk_XMLHTTP.aspx";
		    sFile += "?CwztGUID=" + document.all("txtCwztGUID").value + "&Application=" + document.all("txtApplication").value + "&ParentCode=" + document.all("txtParentCode").value 
		    sFile += "&IsUsedScopeRepeat=" + document.all("txtIsUsedScopeRepeat").value + "&OperType="+ escape(document.all["txtOperType"].value);
		    var sReturns = "";
		    sReturns = openCwjkXmlHTTP(sFile,"SaveOperType",document.all["txtUsedScope"].value);
		    if (sReturns != undefined)
		    {
		        var arrRtn = sReturns.split("|")
		        if (arrRtn.length ==2)
		        {
		            if (arrRtn[0] =="YES")
		            {
		                parent.window.returnValue = arrRtn[1] ;
	                    parent.window.close();
	                }
	                else if(arrRtn[0] =="NO")
	                {
	                    alert(arrRtn[1]);
	                }
	                else
	                {
	                    alert("适用范围与当前业务分类下的“"+ arrRtn[1] +"”的适用范围有重复！");
	                }
		        }
		        else
		        {
		            alert("系统错误，请联系管理员！");
		        }
		    }
		    else
		    {
		        alert("系统错误，请联系管理员！");
		    }
	        
	    }
	    //选择适用范围
	    function SelectUsedScope()
	    {
	        var strPath = "";
	        var strParamList = "";
	        if(document.all["txtApplication"].value == "0101")
	        {
	            strPath="/PubProject/Cwjk/Cwjk_SelectFeeItem.aspx";
	            strParamList = "CwztGUID=" + document.all["txtCwztGUID"].value + "&ParentCode=" + document.all["txtParentCode"].value + "&IsUsedScopeRepeat=" + document.all["txtIsUsedScopeRepeat"].value + "&SelectUsedScope=" + escape(document.all["txtUsedScope"].value);
	        }
	        else
	        {
	            strPath="/PubProject/Cwjk/Cwjk_SelectFundParam.aspx";
	            strParamList = "CwztGUID=" + document.all["txtCwztGUID"].value + "&ParentCode=" + document.all["txtParentCode"].value + "&IsUsedScopeRepeat=" + document.all["txtIsUsedScopeRepeat"].value + "&SelectUsedScope=" + escape(document.all["txtUsedScope"].value);
	        }
	        //var oArgs;
	        //oArgs.SelectUsedScope = document.all["txtUsedScope"].value;
	        var arrRtn = openMyDlg("选择适用范围", strPath, strParamList, "", 320, 480);
	        if(arrRtn != undefined)
	        {
	            document.all["txtUsedScope"].value = arrRtn;
	        }
	    }
	</script>
</head>
<body MS_POSITIONING="GridLayout" style="MARGIN: 15px">
    <form id="form1" runat="server">
    <asp:textbox id="txtCwztGUID" runat="server" style="display:none"></asp:textbox>
    <asp:textbox id="txtApplication" runat="server" style="display:none"></asp:textbox>
    <asp:textbox id="txtParentCode" runat="server" style="display:none"></asp:textbox>
    <asp:textbox id="txtIsUsedScopeRepeat" runat="server" style="display:none"></asp:textbox>
    <table style="TABLE-LAYOUT: fixed;FONT-SIZE:9pt; WIDTH: 100%; HEIGHT: 100%" cellSpacing="0" cellPadding="0">
        <colgroup>
			<col width="70">
			<col width="5">
			<col>
		</colgroup>
        <tr height="25" valign="buttom">
            <td class="req">业务分类</td>
            <td ></td>
            <td><input type="text" class="txt" id="txtParentOperType" runat="server"  readOnly ></input>
            </td>
        </tr>
        <TR height="10"><TD colSpan="3"></td>
        <tr height="25">
            <td class="req">业务场景</td>
            <td ></td>
            <td><input type="text" class="txt" id="txtOperType" runat="server" maxlength="50" forbiddenchars="@%#?|,-;'&quot;&amp;&lt;&gt;"></input>
            </td>
        </tr>
        <TR height="10"><TD colSpan="3"></td>
        <tr height="25" >
            <td class="req">适用范围</td>
            <td ></td>
            <td height="25">
                <table cellpadding="0" cellspacing="0" width="100%" style="TABLE-LAYOUT:fixed">
                    <col>
                    <col width="25" align="right">
                    <tr valign="top">
                        <td><input type="text" id="txtUsedScope" runat="server" readOnly style="background-color:transparent;border-color:#cccccc"></input></td><td align="right"><img style="cursor:hand" src="/_imgs/btn_off_lookup.gif" onclick="SelectUsedScope()" />
                        </td>
                    </tr>
                 </table>
            </td>
        </tr>
        <TR height="10"><TD colSpan="3"></td>
        <TR height="40">
			<TD class="buttons" colSpan="3">
				<TABLE style="TABLE-LAYOUT: fixed; WIDTH: 100%; HEIGHT: 100%" cellSpacing="0" cellPadding="0">
					<TR>
						<TD align="right">
							<BUTTON style="WIDTH: 70px" onclick="Save()" id="btnSave" type="button">保 存</BUTTON>&nbsp;&nbsp;
							<BUTTON style="WIDTH: 70px" onclick="parent.window.close();" id="btnClose" type="button">关 闭</BUTTON>
						</TD>
					</TR>
				</TABLE>
			</TD>
		</TR>
    </table>
    </form>
</body>
</html>
